********************************************************************************
* ELECTORAL REPERCUSSIONS OF A PANDEMIC:  EVIDENCE FROM THE 2009 H1N1 OUTBREAK *
********************************************************************************

// NOVEMBER 2, 2021

// THIS FILE REPLICATES FIGURE 1 IN THE MAIN TEXT OF "ELECTORAL 
// REPERCUSSIONS OF A PANDEMIC: EVIDENCE FROM THE 2009 H1N1 OUTBREAK" BY
// EMILIO GUTIÉRREZ, JAAKKO MERILÄINEN, AND ADRIÁN RUBLI

global data "XXX" // Insert data directory here
global output "XXX" // Insert output directory here

* Install required package

ssc install blindschemes, replace

* Open data

use "$data/GMR_weekly_cases.dta", clear

********************************************************************************

* Figure 1

tsset week

twoway (tsline sum_aris, xtitle("Week") ytitle("ARIs (1000s)") scheme(plotplain) xline(27) yaxis(1)) ///
	(tsline excess, ytitle("Excess cases (1000s)", axis(2)) yaxis(2)), ///
	legend(label(1 "ARIs (1000s)") label(2 "Excess cases (1000s)") cols(2) position(6)) ///
	text(1100 31 "Election")
	
graph export "$output/fg1.eps", as(eps) preview(off) replace
